#pragma once
#include "Dao.h"

class CRecordLogic{
public:
	CRecordLogic(void);
	~CRecordLogic(void);

	void SetDao(CDao *pDao);
	bool SelectRecord(CString strDBName,CString strTableName,vector<CFieldEntity> *pFieldList,CRecordEntity *pRecordEntity,vector<CRecordEntity> *pRecordList);
	bool InsertRecord(CString strDBName,CString strTableName,vector<CFieldEntity> *pFieldList,CRecordEntity *pRecordEntity);
	bool UpdateRecord(CString strDBName,CString strTableName,vector<CFieldEntity> *pFieldList,CRecordEntity *pRecordEntity);
	bool DeleteRecord(CString strDBName,CString strTableName,vector<CFieldEntity> *pFieldList,CRecordEntity *pRecordEntity);
	bool CheckRecord(CString strDBName,CString strTableName,vector<CFieldEntity> *pFieldList,CRecordEntity *pRecordEntity);
	int GetLastError();
	
private:
	CDao *m_pDao;
	int m_nLastError;
};

